<?php

class DefaultIndexAction extends FrontendAction
{

    public function __construct()
    {
        parent::__construct();
        $this->responseType = 'tpl';
        $this->layout = 'index';

        $this->data['layout_class'] = 'yui-t5';
    }

    public function execute()
    {
        //$seoConfig		= C('SettingService')->get('seo_setting',true);
        $seoConfig = array(
            'indextitle' => '正品商城,特卖商城,网上商城',
            'indexkeyword' => '正品商城|特卖商城|网上商城',
            'indexdescription' => '正品商城,精选网上商城正品及特卖产品,支付宝购买.'
        );

        $seoTitle = $this->getSeoStr($seoConfig['indextitle'], array());
        $seoKeyword = $this->getSeoStr($seoConfig['indexkeyword'], array());
        $seoDescription = $this->getSeoStr($seoConfig['indexdescription'], array());

        $this->data['seo']['title'] = $seoTitle;
        $this->data['seo']['keyword'] = $seoKeyword;
        $this->data['seo']['description'] = $seoDescription;

        $page = rand(1, 420);
        $pageSize = 20;
        $num = $pageSize;
        $start = ($page - 1) * $pageSize;
        $categoryService = new CategoryService();
        $categoryList = $categoryService->getSitemapCategoryList($start, $num);
        $this->data['categoryList'] = $categoryList['rows'];

        $page = rand(1,50);
        $pageSize = 20;
        $num = $pageSize;
        $start = ($page - 1) * $pageSize;
        $con = array();
        $hotkeyService = new HotkeyService();
        $list = $hotkeyService->getList($con, 'id DESC', $start, $num);
        $this->data['hotList'] = $list['rows'];
    }

}
